# def test(a1="Ruby", a2="Perl")
#    puts "编程语言为 #{a1}"
#    puts "编程语言为 #{a2}"
# end
# test "C", "C++"
class AllButPattern
  def initialize(except)
    @except = except
  end

  def to_pattern(options)
    if options == 'hello'
        puts 'hello'
    elsif options == ~/l(.*)/
        puts 'I will repeat'
    else return self
    end
  end

  def params(route)
    return {} unless @except === route
  end
end

def all_but(pattern)
  AllButPattern.new(pattern)
end
puts all_but("hello")
puts all_but("hello1")
